package com.donzell.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.donzell.dao.UserDao;
import com.donzell.model.EcsUsers;

@Service
@Transactional
public class UserService {
    @Autowired
    private UserDao userDao;
    
    public String add(EcsUsers user){
        userDao.save(user);
        return "添加成功！";
    }
    
    public String addUser(String account){
    	EcsUsers user = new EcsUsers();
        user.setEmail(account);
        userDao.save(user);
        return "添加成功！";
    }
    
    public EcsUsers getOneUser(Long id){
        return userDao.findOne(id);
    }
    public EcsUsers getOneUser(){
//    	return userDao.getAAA();
    	return null;
    }
}